package chapter02;

/**
 * 使用break终止循环体,break可以放弃整个循环体,而continue可以放弃部分循环体
 * Created by a on 2017/6/9.
 */
public class Test39 {
    public static void main(String[] args) {
        //创建string类型数组
        String[] array = {"白鹭","丹顶鹤","黄鹂","鹦鹉","乌鸦","喜鹊","老鹰","布谷鸟","老鹰","灰文鸟","老鹰","百灵鸟"};
        System.out.println("在你发现第一只老鹰之前，告诉我都有什么鸟。");
        for (String str:array){
            if (str.equals("老鹰"))
                break;
            System.out.println("有： "+str+"  ");
        }

    }
}
